package com.hopes.bizz.poll.common.service;

import com.hopes.bizz.poll.common.constant.MonitorConstant;
import com.hopes.bizz.poll.factor.mapper.PollFactorInfoMapper;
import com.hopes.bizz.poll.information.mapper.PollTownMapper;
import com.hopes.bizz.poll.monitor.mapper.PollMonitorSiteMapper;
import com.hopes.bizz.poll.monitor.mapper.PollMonitorTypeMapper;
import com.hopes.bizz.poll.video.mapper.PollVdVideoMapper;
import com.hopes.bizz.poll.water.mapper.PollWaterSourceProtectionAreaMapper;
import com.hopes.boss.admin.api.entity.SysDictItem;
import com.hopes.boss.common.service.TableDictService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yumr
 * @ProjectName biz
 * @Description 环保模块（字典）
 * @time 2023/5/22 14:38
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class PollDictServiceImpl implements TableDictService {

    private final PollFactorInfoMapper pollFactorInfoMapper;

    private final PollMonitorSiteMapper pollMonitorSiteMapper;

    private final PollVdVideoMapper pollVdVideoMapper;

    private final PollTownMapper pollTownMapper;

    private final PollMonitorTypeMapper pollMonitorTypeMapper;

    private final PollWaterSourceProtectionAreaMapper pollWaterSourceProtectionAreaMapper;

    /* 因子信息 */
    public List<SysDictItem> listFactorInfoAsDict() {
        return pollFactorInfoMapper.labelValueList();
    }

    /* 因子信息 */
    public List<SysDictItem> listFactorInfoByCodeAsDict() {
        return pollFactorInfoMapper.listFactorInfoByCodeAsDict();
    }

    /* 监控站点 */
    public List<SysDictItem> listMonitorSiteAsDict() {
        return pollMonitorSiteMapper.labelValueList();
    }

    /* 监控站点mn */
    public List<SysDictItem> queryMonitorSiteMnAsLabelValue() {
        return pollMonitorSiteMapper.queryMonitorSiteMnAsLabelValue();
    }

    public List<SysDictItem> queryMonitorSiteTownAsLabelValue() {
        return pollMonitorSiteMapper.queryMonitorSiteTownAsLabelValue();
    }

    /* 区域id */
    public List<SysDictItem> queryRegionIdAsLabelValue() {
        return pollVdVideoMapper.queryRegionIdAsLabelValue();
    }

    public List<SysDictItem> listTownInfoAsDict() {
        return pollTownMapper.listTownInfoAsDict();
    }

    public List<SysDictItem> listWaterAreaInfoAsDict() {
        return pollWaterSourceProtectionAreaMapper.listWaterAreaInfoAsDict();
    }

    public List<SysDictItem> siteTypeAsDict() {
        return pollMonitorTypeMapper.siteTypeAsDict(null);
    }

    public List<SysDictItem> siteTypeAirAsDict() {
        return pollMonitorTypeMapper.siteTypeAsDict(MonitorConstant.MONITOR_TYPE_AIR);
    }

    public List<SysDictItem> siteTypePollAsDict() {
        return pollMonitorTypeMapper.siteTypeAsDict(MonitorConstant.MONITOR_TYPE_POLL);
    }

    public List<SysDictItem> siteTypeWaterAsDict() {
        return pollMonitorTypeMapper.siteTypeAsDict(MonitorConstant.MONITOR_TYPE_WATER);
    }
}
